home *** CD-ROM | disk | FTP | other *** search
- class Heroes.BodyBox extends Heroes.AnyBox
- {
- var myBox;
- function BodyBox()
- {
- super();
- if(this._parent._parent.facing == "right")
- {
- this.myBox = new Heroes.Box(this._x + this._parent._parent.x,this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2,this._width,this._height,this._width);
- }
- else
- {
- this.myBox = new Heroes.Box(this._parent._parent.x - this._x - this._width,- this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2,this._width,this._height,this._width);
- }
- }
- function onEnterFrame()
- {
- super.onEnterFrame();
- if(this._parent._parent.facing == "right")
- {
- this.myBox.setLocation(this._x + this._parent._parent.x,this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2);
- }
- else
- {
- this.myBox.setLocation(this._parent._parent.x - this._x - this._width,- this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2);
- }
- this.myBox.setSize(this._width,this._height,this._width);
- }
- function isHitting(attackBox)
- {
- return this.myBox.isHitting(attackBox);
- }
- function isTouching(px, py, pz)
- {
- return this.myBox.isTouching(px,py,pz);
- }
- function toString()
- {
- return this.myBox.toString();
- }
- }
-